/*
 * =====================================================================================
 *
 *       Filename:  test.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  07/11/2012 10:14:31 PM
 *       Revision:  none
 *       Compiler:  gcc/g++
 *
 *         Author:  wangtengchao , wangtengchao AT gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */

#include"ipString.h"
#include"inetAddr.h"
#include"netBuffer.h"
#include "dispatcher.h"
#include "acceptor.h"
#include "eventHandler.h"
#include "epoll.h"
#include "netHelp.h"
#include "tcpServer.h"
#include<iostream>
#include<string>
#include<fcntl.h>
#include<unistd.h>
#include<sys/uio.h>
#include "inmServer.h"
using namespace std;

using namespace inm::net;
int main()
{

    InetAddr addr(6666);
	InmServer is(addr,1);
    is.run();


    /*

    int fd;
    if((fd= open("1.txt",O_RDWR)) < 0)
        cout<<"open error"<<endl;
    NetBuffer buf;
    size_t s;
    buf.readFromFd(fd);
    cout<<buf.readableNum()<<endl;
    uint32_t size = htonl( 70000);
    buf.prepend(&size,sizeof(size));
    cout<<buf.readableNum()<<endl;
    const void* len1 = buf.toString().data();
    cout<<ntohl(*(uint32_t*)(len1))<<endl;
    */
/*
    s = buf.readableNum();
    cout<<"1"<<s<<buf.toString()<<endl;
    buf.readFromFd(fd);
    s = buf.readableNum();
    cout<<"2"<<s<<buf.toString()<<endl;
    s = buf.readableNum();
    cout<<"3"<<s<<buf.readAndDelete(s)<<endl;
    cout<<buf.readableNum()<<buf.toString()<<endl;
    buf.write("a",1);
    s = buf.readableNum();
    cout<<"4"<<s<<buf.toString()<<endl;
*/

	return 0;

}
